package com.xxxx.manager.config;

import com.xxxx.manager.interceptor.ManagerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/*
拦截器配置类
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    @Autowired
    private ManagerInterceptor managerInterceptor;


    /*
    addPathPatterns  添加拦截的资源
    excludePathPatterns  放行的资源
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(managerInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns(
                        "/goods/**",
                        "/index/Admin/System/login_task",
                        "index",
                        "/img/**",
                        "/user/login/**",
                        "/js/**",
                        "/css/**",
                        "/dist/**",
                        "/bootstrap/**",
                        "/images/**",
                        "/plugins/**",
                        "/user/logout/**",
                        "/login/**",
                        "/static/**",
                        "/image/getKaptchaImage");
    }



}
